<template>
  <div class="Toppadding">
    <my-head title='编辑地址'></my-head>
    <div>
        <van-address-edit
        :area-list="areaList"
        :area-columns-placeholder="['请选择', '请选择', '请选择']"
        @save="onSave"
        />
    </div>
  </div>
</template>

<script>
import { areaList } from '@vant/area-data';
import { Toast } from 'vant';
export default {
  data() {
    return {
      areaList,
      searchResult:null,
    };
  },
  methods: {
    onSave(values) {
      if(this.userInfo){
            console.log(values);
            // 保存地址信息  用户信息
            this.$ajax.savePlace({
               phone:this.userInfo.phone,
               placeVal:values
            }).then(res=>{
              Toast('添加地址成功');
              //跳转到编辑地址页面
              this.$router.push({
                name:'placeList'
              })
            })
      }
      
    },
  },
  mounted() {
    console.log(this.userInfo);
    
  },
};
</script>

<style>

</style>